# -*- coding: utf-8 -*-
from __future__ import unicode_literals
#import django
#django.setup()
from django.db import models
from django.contrib import admin
from django.utils.encoding import python_2_unicode_compatible

# Create your models here.
class BlogPost(models.Model):
    title = models.CharField(max_length = 150)
    content = models.TextField()
    
class test01(models.Model):
    title = models.CharField(max_length = 50)
    content = models.CharField(max_length = 100)
    def __unicode__(self):
        return self.title
    
class User(models.Model):
    username = models.CharField(max_length=50)
    password = models.CharField(max_length=50)
        
@python_2_unicode_compatible
class Article(models.Model):
    title = models.CharField('标题', max_length=256)
    content = models.TextField('内容')
 
    pub_date = models.DateTimeField('发表时间', auto_now_add=True, editable = True)
    update_time = models.DateTimeField('更新时间',auto_now=True, null=True)
 
    def __str__(self):
        return self.title

class apiurl(models.Model):
    name = models.CharField(max_length=50)
    url = models.CharField(max_length=60)
    def __unicode__(self):
        return self.name
    class Meta:
        unique_together = ('name','url',)